package com.langerra.server.channel;

import java.io.Serializable;

import com.langerra.shared.channel.ChannelMessage;
import com.langerra.shared.channel.ChannelServicePool;

public class ChannelServicePoolImpl<T extends Serializable>
		implements ChannelServicePool<T> {

	ChannelImpl<T> channel;

	public ChannelServicePoolImpl(
			ChannelImpl<T> channel) {
		this.channel = channel;
	}

	@Override
	public ChannelMessage<T> getMessage(
			T message) {
		return new ChannelMessage<T>(message);
	}

	@Override
	public T get(
			Long key) {
		return channel.read(key, true);
	}
}
